//
// Created by martin on 8/19/21.
//

#ifndef FTPSERVER2_0_THREADPOOL_H
#define FTPSERVER2_0_THREADPOOL_H

#include "nthread.h"
#include "task.h"

typedef struct threadpool {
    nThread *threads; /* 线程(数组)队列 */
    int thread_nums;
    int last_thread_id;
}ThreadPool;

//ThreadPool *threadoool_new();
//void threadpool_free(ThreadPool *pool);
ThreadPool *threadPool_getInstance();
int threadpool_init(ThreadPool *pool, int num);
int threadpool_dispatchTask(ThreadPool *pool, Task *task);

#endif //FTPSERVER2_0_THREADPOOL_H
